<template>
  <!-- 自营商品小日历 -->
  <view class="little-calendar">
    <view class="title">出行日期</view>
    <view class="calendar-view">
      <view class="left">
        <text style="font-weight:800;">{{ datetime }}</text>
      </view>
      <view class="right" @click="showLargeCalendar">更改日期</view>
    </view>
    <!-- 大日历 -->
    <calendar :show="show" :datetime="datetime" :uid="uid" @close="closeEject" @changeDate="changeDate" />
  </view>
</template>
<script>
import calendar from '@com/self/calendar'
export default {
  components: {
    calendar
  },
  props: {
    datetime: {
      type: String,
      default: null
    },
    uid: {
      type: String,
      default: null
    }
  },
  data() {
    return {
      show: false,
      dateList: null
    }
  },
  methods: {
    showLargeCalendar() {
      this.show = true
    },
    closeEject() {
      this.show = false
    },
    changeDate(date) {
      this.$emit('changeDate', date)
    }
  }
}
</script>

<style lang="scss" scoped>
.little-calendar {
  width: 710rpx;
  background: #ffffff;
  box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(0, 0, 0, 0.1);
  border-radius: 8rpx;
  margin-left: 20rpx;
  margin-bottom: 30rpx;
  margin-top: 30rpx;
  padding-top: 30rpx;
  padding-bottom: 40rpx;
  .title {
    font-size: 32rpx;
    font-weight: 800;
    margin-left: 30rpx;
  }
  .calendar-list {
    display: flex;
    justify-content: start;
    flex-wrap: wrap;
  }
  .calendar-list-item {
    width: 136rpx;
    min-height: 136rpx;
    margin-left: 30rpx;
    background: #ffffff;
    box-shadow: 0px 0rpx 12rpx 0px rgba(215, 215, 215, 0.5);
    border-radius: 8rpx;
    margin-top: 30rpx;
    overflow-x: hidden;
    border: 2rpx solid;
    border-color: #ffffff;
  }
  .calendar-list-item-content {
    display: flex;
    flex-direction: column;
    justify-content: start;
    text-align: center;
    font-weight: 800;
    font-size: 28rpx;
  }
}
.calendar-list-item {
  .calendar-list-item-top {
    height: 40rpx;
    width: 136rpx;
    background-color: #306de9;
    border-radius: 8rpx 8rpx 0 0;
    color: #ffffff;
    font-size: 24rpx;
    text-align: center;
    line-height: 40rpx;
  }
}
.not-open {
  background-color: #b9b9b9 !important;
  color: #9b9b9b !important;
  border-color: #b9b9b9;
}
.active {
  border-color: #306de9 !important;
  background-color: #eaf0fc !important;
  .calendar-list-item-content {
    .date {
      color: #306de9 !important;
    }
    .price {
      color: #306de9 !important;
    }
  }
}
.calendar-view {
  display: flex;
  justify-content: space-between;
  margin-top: 30rpx;
  .left {
    width: 288rpx;
    border: 2rpx solid #306de9;
    background-color: #eaf0fc;
    height: 60rpx;
    border-radius: 8rpx;
    display: flex;
    justify-content: space-around;
    line-height: 60rpx;
    margin-left: 30rpx;
    text {
      font-size: 28rpx;
      color: #306de9;
    }
  }
  .right {
    font-size: 28rpx;
    color: #306de9;
    margin-right: 30rpx;
    line-height: 60rpx;
  }
}
</style>
